import request from '@/utils/request'
// 区域列表
export const regionSearch = (params) => {
  return request({
    url: '/api/vm-service/region/search',
    params
  })
}
// 新增区域
export const addRegion = (data) => {
  return request({
    url: '/api/vm-service/region',
    method: 'POST',
    data
  })
}
// 获取区域详情
export const regionInfo = (regionId) => {
  return request({
    url: `/api/vm-service/region/${regionId}`
  })
}
// 点位搜索 /api/vm-service/node/search
export const nodeSearch = (params) => {
  return request({
    url: `/api/vm-service/node/search`,
    params
  })
}
// 修改区域
export const editRegionInfo = (id, data) => {
  return request({
    url: `/api/vm-service/region/${id}`,
    method: 'PUT',
    data
  })
}
// 删除区域
export const delRegion = (id) => {
  return request({
    url: `/api/vm-service/region/${id}`,
    method: 'DELETE'
  })
}
// 商圈列表
export const businessType = () => {
  return request({
    url: `/api/vm-service/businessType`
  })
}
// 合作商搜索
export const partnerSearch = (params) => {
  return request({
    url: `/api/user-service/partner/search`,
    params
  })
}
// 新增点位
export const addNode = (data) => {
  return request({
    url: `/api/vm-service/node`,
    data,
    method: 'POST'
  })
}
// 点位详情
export const vmList = (id) => {
  return request({
    url: `/api/vm-service/node/vmList/${id}`
  })
}
// 修改点位
export const editNode = (id, data) => {
  return request({
    url: `/api/vm-service/node/${id}`,
    method: 'PUT',
    data
  })
}
// 删除点位

export const delNode = (id) => {
  return request({
    url: `/api/vm-service/node/${id}`,
    method: 'DELETE'
  })
}
// 新增合作商
export const addPartner = (data) => {
  return request({
    url: `/api/user-service/partner`,
    method: 'POST',
    data
  })
}
// 重置合作商密码
export const resetPwd = (id) => {
  return request({
    url: `/api/user-service/partner/resetPwd/${id}`,
    method: 'PUT'
  })
}
// 修改合作商
export const editPartner = (id, data) => {
  return request({
    url: `/api/user-service/partner/${id}`,
    method: 'PUT',
    data
  })
}
// 删除合作商
export const delPartner = (id, data) => {
  return request({
    url: `/api/user-service/partner/${id}`,
    method: 'DELETE',
    data
  })
}
